package com.kg.sdk.activity;

import android.app.Activity;
import android.content.res.Configuration;
import android.os.Bundle;
import android.util.Log;

import com.kg.sdk.Density;
import com.kg.sdk.dlg.WaitingDialog;

public class KPCommonActivity extends Activity {
    protected WaitingDialog mWaitingDialog;
    public void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        int width = getResources().getDisplayMetrics().widthPixels;
        int height = getResources().getDisplayMetrics().heightPixels;
        if(height > width){
           Density.setDefault(this);
        }else{
        //    Density.setOrientation(this,Density.WIDTH);
        }
        mWaitingDialog = new WaitingDialog(this);
    }

    public void onDestroy(){
        super.onDestroy();
        if(mWaitingDialog != null){
            mWaitingDialog.closeDialog();
        }
    }

    public void onConfigurationChanged(Configuration newConfig){
        super.onConfigurationChanged(newConfig);
        int width = getResources().getDisplayMetrics().widthPixels;
        int height = getResources().getDisplayMetrics().heightPixels;
        if(height > width){
            Density.setDefault(this);
        }else{
            //Density.setOrientation(this,Density.WIDTH);
        }
    }



}
